package entity;
//甜点类

import Tools.Tool;
import java.awt.*;
import java.util.Random;

public class Dessert extends Tool {
     public int x,y,height,widht,score;
     public String name,url;
     public Image image;

     public Dessert(Image image){
         this.image=image;

         //System.out.println(ran.nextInt(50));
         this.x=0;
         this.y=0;
         this.widht=100;
         this.height=100;
     }


     public Dessert(int score, String name, String url) {
         this.score = score;
         this.name = name;
         this.url = url;
     }

     public void paintSelf(Graphics g){
         g.drawImage(this.image,this.x,this.y,widht,height,null);
     }

     public void move(Basket b){
         this.y++;
         //System.out.println(b.x);

//         Point p=new Point(this.x, this.y);
//         Point p1=new Point(this.x+this.widht, this.y);
//         Point p2=new Point(this.x, this.y+this.height);
//         Point p3=new Point(this.x+this.widht, this.y+this.height);
//            Rectangle rectB = new Rectangle(b.x, b.y, b.widht, b.height);
//            Rectangle rectA = new Rectangle(this.x, this.y, this.widht, this.height);
//            if(rectB.contains(p)||rectB.contains(p1)||rectB.contains(p2)||rectB.contains(p3)){
//                System.out.println("碰撞啦！");
//            }

     }


 }
